Topic 1 Question #5
Your website is deployed on Compute Engine. Your marketing team wants to test conversion rates between 3 different website designs.Which approach should you use?
- A.
Deploy the website on App Engine and use traffic splitting.
- B.
Deploy the website on App Engine as three separate services.
- C.
Deploy the website on Cloud Functions and use traffic splitting.
- D.
Deploy the website on Cloud Functions as three separate functions.
Answer: A
The scenario requires a low-overhead method to run A/B/n testing for three website design variants to measure conversion rates, with minimal refactoring from the existing Compute Engine web deployment. The core requirement is native traffic splitting to route controlled portions of user traffic to each design variant without custom infrastructure management. App Engine's built-in traffic splitting feature is purpose-built for this use case, as it allows deploying multiple versions of a single web service and allocating traffic by percentage, user IP, or cookie to support consistent, measurable testing of different application variants. This approach eliminates the need to build custom routing logic, reduces operational overhead, and aligns with GCP best practices for web application testing covered in the Professional Cloud Developer certification. Option Analysis:
A. Correct. App Engine natively supports traffic splitting across multiple versions of a single service, which allows you to deploy each of the three website designs as a separate version of the same App Engine service, then assign a defined percentage of end-user traffic to each version. This requires minimal refactoring of the existing web application from Compute Engine, as App Engine supports all common web runtimes, and the native traffic splitting feature removes the need to manage custom load balancer rules or routing logic for the conversion test. This directly addresses the scenario requirements with the least operational and development overhead, aligned with GCP best practices.
B. Incorrect. Separate App Engine services are intended for distinct, decoupled components of an application (e.g. a frontend service, backend API service, and admin service), not for different variants of the same frontend. Deploying three separate services would require implementing custom traffic routing at the external load balancer or CDN layer to split user traffic between the three service endpoints, adding unnecessary operational complexity and cost that is not required when using native version-level traffic splitting.
C. Incorrect. Cloud Functions are event-driven serverless compute resources designed for short-lived, single-purpose workloads triggered by specific events (e.g. cloud storage uploads, Pub/Sub messages, HTTP requests for discrete endpoints). They are not designed to host full end-to-end website deployments, and do not offer native traffic splitting capabilities for full web workloads. Refactoring an entire existing website from Compute Engine to Cloud Functions would require significant unnecessary development effort for this temporary testing use case.
D. Incorrect. Deploying three separate Cloud Functions for the three website designs combines the drawbacks of option B and C: it requires full refactoring of the website to a function-based architecture, plus custom traffic routing to split users between the three independent function endpoints. This approach is operationally complex, costly, and misaligned with the intended use case for Cloud Functions, making it an invalid solution for this scenario. Key Concepts:
1. App Engine Version and Traffic Splitting: App Engine organizes deployments into services, each with multiple independent versions. Native traffic splitting across versions supports use cases including canary rollouts, A/B/n testing, and incremental feature launches, eliminating the need for custom routing infrastructure.
2. Workload Placement for GCP Compute Services: Matching compute services to workload requirements is a core Professional Cloud Developer competency. App Engine is optimized for managed web application hosting, while Cloud Functions are optimized for event-driven, discrete workloads, so selecting the appropriate service reduces development and operational overhead.
3. A/B/n Testing Best Practices: For user-facing conversion testing, native platform traffic splitting ensures consistent user assignment, accurate performance measurement, and minimal disruption to end users, which is preferred over custom routing implementations. References:
Splitting Traffic, Google Cloud App Engine Documentation,
https://cloud.google.com/appengine/docs/standard/splitting-traffic
Professional Cloud Developer Certification Guide, Google Cloud